<?php

class Core_Template_Html_Grid_Cell_Status_Label extends Soul_Template_Html_Grid_Cell_Label {

	public function __construct(){
		parent::__construct();
		$this->addClass('status');
	}

	protected function render(){
		$text = $this->getFormatText();
        $translator = $GLOBALS[RC]->getLanguage();
        switch($text){
        	case CONSTANT_STATUS_DRAFT:
        		return '<td'.$this->getAttributeHtml().'><span>'.$translator->__('system.status.draft').'</span></td>';
        	case CONSTANT_STATUS_PENDING:
        		return '<td'.$this->getAttributeHtml().'><span class="yellow">'.$translator->__('system.status.pending').'</span></td>';
        	case CONSTANT_STATUS_PUBLISHED:
        		return '<td'.$this->getAttributeHtml().'><span class="green">'.$translator->__('system.status.published').'</span></td>';
        	case CONSTANT_STATUS_FORBIDDEN:
        		return '<td'.$this->getAttributeHtml().'><span class="red">'.$translator->__('system.status.forbidden').'</span></td>';
        	case CONSTANT_STATUS_ENABLED:
        		return '<td'.$this->getAttributeHtml().'><span class="green">'.$translator->__('system.status.enabled').'</span></td>';
        	case CONSTANT_STATUS_DISABLED:
        		return '<td'.$this->getAttributeHtml().'><span class="red">'.$translator->__('system.status.disabled').'</span></td>';
        	case CONSTANT_STATUS_PROCESSING:
        		return '<td'.$this->getAttributeHtml().'><span class="yellow">'.$translator->__('system.status.processing').'</span></td>';
			case CONSTANT_STATUS_DELETED:
        		return '<td'.$this->getAttributeHtml().'><span class="red">'.$translator->__('system.status.deleted').'</span></td>';
			case CONSTANT_STATUS_EXPIRED:
        		return '<td'.$this->getAttributeHtml().'><span class="red">'.$translator->__('system.status.expired').'</span></td>';
        }   	
        return '<td'.$this->getAttributeHtml().'><span>' . $text . '</span></td>';
	}
}